package org.example.demo1_danyi.one;

import java.sql.Connection;

public class Main {
    public static void main(String[] args) {
        LoginDisplay loginDisplay = new LoginDisplay();
        LoginVerifier loginVerifier = new LoginVerifier();
        ConnectionProvider connectionProvider = new ConnectionProvider();
        LoginManager loginManager = new LoginManager(loginDisplay, loginVerifier, connectionProvider);

        loginManager.initialize();
        loginManager.display();

        String username = "user";
        String password = "pass";
        if (loginManager.verify(username, password)) {
            Connection connection = loginManager.getConnection();
            // 使用数据库连接执行操作
        } else {
            // 登录失败处理
        }
    }
}